package com.yzs.controller.admin;

import com.yzs.common.bean.R;
import com.yzs.service.IOrderService;
import com.yzs.utils.JwtUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@CrossOrigin
@RequestMapping("/order")
public class OrderController {
    @Autowired
    IOrderService os;

    @RequestMapping("getOrderByRolePage")
    public R getOrderByPageRole(@RequestParam Integer currentPage, @RequestParam Integer pageSize, HttpServletRequest req){
        String token = req.getHeader("token");
        return os.getOrderByRolePage(token,currentPage,pageSize);
    }

    @RequestMapping("/deleteOrder")
    public R deleteNotice(@RequestParam String id){return os.deleteOrder(id);}

    @RequestMapping("/editOrderStep")
    public R editOrderStep(@RequestParam String oid,@RequestParam Integer step){return os.editOrderStep(oid,step);}
}
